Nested VMX: Add VMXE bits in virtual CR4
authorEddie Dong <eddie.dong@intel.com>
Thu, 9 Jun 2011 08:24:09 +0000 (16:24 +0800)
committerEddie Dong <eddie.dong@intel.com>
Thu, 9 Jun 2011 08:24:09 +0000 (16:24 +0800)
Signed-off-by: Qing He <qing.he@intel.com>
Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
xen/include/asm-x86/cpufeature.h
xen/include/asm-x86/hvm/hvm.h

index 3e6d4c5c801f706e5f57e72293573f8d461546a8..fa7dd4519160bb46d316db8385d9e3479996331c 100644 (file)
 
 #define cpu_has_svm            boot_cpu_has(X86_FEATURE_SVM)
 
+#define cpu_has_vmx            boot_cpu_has(X86_FEATURE_VMXE)
+
 #endif /* __ASM_I386_CPUFEATURE_H */
 
 /* 
index 70e79978bcb1a5a21406896018cafac109dfd474..527edcb5d31c9270959540e1c70c0065f6df071f 100644 (file)
@@ -325,6 +325,8 @@ static inline int hvm_do_pmu_interrupt(struct cpu_user_regs *regs)
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
         (cpu_has_smep ? X86_CR4_SMEP : 0) |             \
+        ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
+                      ? X86_CR4_VMXE : 0)  |             \
         (xsave_enabled(_v) ? X86_CR4_OSXSAVE : 0))))
 
 /* These exceptions must always be intercepted. */